<div class="kong">
    <div class="kong"></div>
    <div class="ad-fa">
        <div class="ad-content">
            我是广告内容
        </div>
    </div>
    <div class="kong"></div>
</div>
<div class="kong"></div>
<style>
    .ad-fa {
        position: sticky;
        top: 50px;
        background-color: red;
    }

    .kong {
        height: 1000px;
    }
</style>